%%%-------------------------------------------------------------------
%%% @author 92913
%%% @copyright (C) 2024, <COMPANY>
%%% @doc
%%%
%%% @end
%%% Created : 20. 7月 2024 10:12
%%%-------------------------------------------------------------------
-module(function).
-author("92913").

%% API
-export([double/1, triple/1, call/2, start/0]).
%% 高阶函数
double(X) -> X * 2.
triple(X) -> X * 3.
call(F, X) ->
  F(X).

start() ->
  F = fun(X) -> triple(X) end,
  X = call(F, 2),
  io:fwrite("~w", [X]).